<template>
  <div class="love-song">
    <div class="song-header">
      <button class="play-all-btn" @click="playAll">
        <span class="play-icon">▶</span>
        播放全部
      </button>
    </div>
    <div class="song-list">
      <div v-for="song in songs" :key="song.id" class="song-item">
        <div class="song-info">
          <div class="song-name">{{ song.name }}</div>
          <div class="song-artist">{{ song.artist }}</div>
        </div>
        <div class="song-duration">{{ song.duration }}</div>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { ref, type Ref } from 'vue'

interface Song {
  id: number
  name: string
  artist: string
  duration: string
}

const songs: Ref<Song[]> = ref([
  { id: 1, name: '示例歌曲1', artist: '示例歌手1', duration: '3:45' },
  { id: 2, name: '示例歌曲2', artist: '示例歌手2', duration: '4:12' },
  { id: 3, name: '示例歌曲3', artist: '示例歌手3', duration: '3:28' }
])

// 播放全部功能
const playAll = () => {
  console.log('播放全部歌曲')
  // 这里可以添加播放全部歌曲的逻辑
}
</script>

<style scoped>
.love-song {
  padding: 20px 0;
}

.song-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid #333;
}

.play-all-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #ff6b6b, #ee5a24);
  color: #ffffff;
  border: none;
  padding: 10px 20px;
  border-radius: 25px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.play-all-btn:hover {
  background: linear-gradient(135deg, #ff5252, #e55100);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.play-icon {
  font-size: 12px;
}

.song-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.song-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 5px;
  transition: background-color 0.3s ease;
}

.song-item:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.song-info {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.song-name {
  color: #ffffff;
  font-size: 16px;
  font-weight: 500;
}

.song-artist {
  color: #999;
  font-size: 14px;
}

.song-duration {
  color: #999;
  font-size: 14px;
}
</style>